
//
//  MessageTableViewCell.m
//  LotteryProject
//
//  Created by 阳光 on 17/7/9.
//  Copyright © 2017年 阳光. All rights reserved.
//

#import "MessageTableViewCell.h"

@interface MessageTableViewCell ()

@property(nonatomic,strong)UILabel *titleLabel;

@property(nonatomic,strong)UILabel *timeLabel;

@end

@implementation MessageTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        // ➡️Cell类型
        self.accessoryType=UITableViewCellAccessoryNone;

        self.titleLabel.font=FontNumber(18);

        self.timeLabel.font=FontNumber(16);

        self.backgroundColor=WhiteColor;
    }
    return self;
}

// titleLabel
- (UILabel *)titleLabel
{

    if (!_titleLabel) {
        _titleLabel=[self getLabelWithText:@"今晚23:00凌晨,火炬彩票将进行系统维护更新呢" font:FontNumber(18) textColor:DarkGreyColor textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByTruncatingTail numberOfLines:1];
        [self.contentView addSubview:_titleLabel];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.mas_equalTo(kmargin*2);
            make.right.mas_equalTo(-kmargin*2);
        }];
    }
    return _titleLabel;
}

// timeLabel
- (UILabel *)timeLabel
{
    if (!_timeLabel) {
        _timeLabel=[self getLabelWithText:@"2016-09-12 09:28:23" font:FontNumber(16) textColor:LightGreyColor textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByTruncatingTail numberOfLines:1];
        [self.contentView addSubview:_timeLabel];
        [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(kmargin);
            make.left.mas_equalTo(self.titleLabel.mas_left);
        }];
    }
    return _timeLabel;
}

@end
